package itheima.chap06;

import java.util.Scanner;

public class TernaryOperator {
    public static void main(String[] args) {
        // 1.键盘录入获取价格
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入商品价格");
        double price = scanner.nextDouble();

        // 2.判断价格，给出优惠（大于等于300打八折，小于300打九折）
        double dicount = price >=300 ? price * 0.8 : price * 0.9;
        System.out.println("打折后价格：" + dicount);
    }
}
